package org.chen.common.exception;

public enum ExceptionCodeEnum implements ExceptionHandler{
    // 数据操作错误定义
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    THE_ORDER_HAS_BEEN_DELETED(201, "订单已删除"),
    REQUESTING_A_REFUND(202, "正在申请退款中"),
    THE_ORDER_HAS_BEEN_REFUNDED(203, "订单已退款"),
    THE_ORDER_IS_BEING_REFUNDED(204, "订单退款中"),
    THE_PAYMENT_HAS_BEEN_COMPLETED(220, "您的付款已完成"),
    ORDER_GENERATION_FAILED(310, "订单生成失败"),
    A_PAYMENT_ORDER_NUMBER_HAS_BEEN_GENERATED(309, "支付单号已生成"),
    THE_ORDER_HAS_EXPIRED(308, "订单已失效"),
    THE_ORDER_DOES_NOT_EXIST(307, "订单不存在"),
    THE_ORDER_HAS_EXPIRED_PLEASE_PLACE_A_NEW_ORDER(306, "订单已失效，请重新下单！"),
    PAYMENT_LINK_GENERATION_FAILED(305, "支付链接生成失败！"),
    THE_PAYMENT_SLIP_DOES_NOT_EXIST(304, "支付单不存在！"),
    THE_ORDER_HAS_BEEN_PAID_FOR(303, "该订单已支付完成！"),
    PRAM_NOT_MATCH(400, "参数不正确"),
    VALIDATE_FAILED(400, "参数检验失败"),
    UNAUTHORIZED(401, "未登录或token过期，请登录！"),
    FORBIDDEN(403, "没有相关权限"),
    NOT_FOUND(404, "没有找到相关数据"),
    THIS_PAYMENT_METHOD_IS_NOT_SUPPORTED_AT_THIS_TIME(405, "暂不支持该支付方式，请刷新页面或者联系管理员"),
    THE_PAYMENT_CHANNEL_CANNOT_BE_EMPTY(406, "支付渠道不能为空!"),
    THE_PAYMENT_CHANNEL_DOES_NOT_EXIST(407, "支付渠道不存在!"),
    THE_PRE_ORDER_DOES_NOT_EXIST(408, "预下单订单不存在!"),
    THE_LIST_OF_PRE_PLACED_ORDERS_CANNOT_BE_EMPTY(409, "预下单订单列表不能为空!"),
    NO_RELEVANT_ORDER_INFORMATION_FOUND(410, "没有找到相关订单信息!"),
    ORDERS_CAN_T_BE_DELETED_DURING_THE_REFUND_PROCESS(411, "订单在退款流程中无法删除"),
    ONLY_COMPLETED_ORDERS_CAN_BE_DELETED(412, "只能删除已完成订单"),
    UNPAID_ORDERS_CANNOT_BE_DELETED(413, "未支付订单无法删除"),
    THE_ORDER_STATUS_IS_INCORRECT(414, "订单状态错误"),
    THE_REFUND_REQUEST_FAILED(415, "申请退款失败"),
    INVALID_ORDER_DATA(416,"订单数据无效"),
    ORDER_BEING_PROCESSED(417,"订单正在处理中，请稍后再试"),
    ORDER_ALREADY_PROCESSED(418,"该订单已经处理过"),
    ORDER_DELETION_FAILED(419,"订单删除失败"),
    SYSTEM_BUSY(420,"系统繁忙，请稍后重试"),
    PRE_ORDER_FAILED(421,"预下单失败"),
    ORDER_NOT_EXIST(422,"订单不存在"),
    ORDER_UPDATED(423,"订单状态已变更，请刷新后重试"),
    SYSTEM_ERROR(424,"取消订单时发生错误"),
    PAYMENT_ALREADY_PROCESSED(425,"该订单已支付"),
    PAYMENT_PROCESSING_ERROR(426,"支付处理出错"),
    REFUND_ALREADY_PROCESSED(427,"退款申请已处理"),
    ORDER_UPDATE_FAILED(428,"订单状态更新失败,退款失败"),
    ERROR(500, "系统异常"),
    PAYMENT_AMOUNT_EXTRACT_FAILED(430, "提取支付金额失败"),
    PAYMENT_VERIFY_FAILED(431, "支付验证失败");

    private long code;
    private String message;

    private ExceptionCodeEnum(long code, String message){
        this.code = code;
        this.message = message;
    }

    @Override
    public long getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

}
